<?php

class Base_Controller extends Controller {

	/**
	 * Catch-all method for requests that can't be matched.
	 *
	 * @param  string    $method
	 * @param  array     $parameters
	 * @return Response
	 */

    protected $theme;
    protected $lang;
    protected $location;


    public function __construct()
    {
        $this->theme = IoC::resolve('Theme');
        $this->lang = 'en';
        $this->location = Location::get();
    }

    public function __call($method, $parameters)
    {
        return Response::error('404');

    }

    //--GET SLUG ID FROM URL
    public static function SlugID($table,$slug){
        if(!empty($table) && !empty($slug)){
            $d = DB::table($table)->select('id')->where('slug','=',$slug)->first();

            if($d) {
                return $d->id;
            }else{
                return "0";
            }
        }

    }



}
?>